<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #cats li {
            background-color: pink;
            height: 40px;
            line-height: 40px;
            position: relative;
            color:white;
        }
        #cats li:after{
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 1px;/*一像素有点粗怎么办 0.5px 不存在 */
            background-color:green;
            /*变形属性*/
            transform: scaleY(0.5);/* 垂直方向 缩放0.5倍*/
        }
    </style>
</head>
<body>
    <ul id="cats"></ul>
    <script>
        const cats=[
        {
            naem:'sss',
            age:2

        },
        {
            naem:'kkk',
            age:2

        },
        {
            naem:'yyy',
            age:2

        }
    ];
    const oUL=document.getElementById('cats');
    // for (item of cats){

    //     oUL.innerHTML+=
    //     `
    //     <li>${item.naem}-${item.age}
    //     </li>
    //     `
    //}
    oUL.innerHTML+= cats.map((cat)=>
        `<li>
            ${cat.naem}-${cat.age}
        </li>`).join('')
    
    </script>
    
</body>
</html>